package org.elena.model.activity;

import org.elena.model.exception.ActivityException;
import org.elena.model.executor.Executor;
import org.elena.model.filter.Filter;
import org.elena.model.sample.Sample;
import org.elena.model.validator.Validator;

public class Activity {
    // 验证activity合法性
    private Validator validator;

    private Filter filter;

    private Executor executor;

    public void evaluate(Sample sample) throws ActivityException {
        // 验证activity的合法性
        validator.validate();
        filter.doFilter(sample);
        executor.execute(sample);
    }

    public static class Builder {
        private String filterJson;

        public Activity build() {
            Activity activity = new Activity();
            return activity;
        }
    }
}
